﻿




using System;
using System.Collections.Generic;
using System.Web.Mvc;
using Hotpot.Modules.Blogs.Models;
using Hotpot.Modules.Blogs.Services;
using Hotpot.ViewModels;

namespace Hotpot.Modules.Blogs.Controllers
{
    public class SiteMapController : Controller
    {
        private readonly IPostService postService;

        public SiteMapController(IPostService postService)
        {
            this.postService = postService;
        }

        public HotpotViewModelItems<DateTime> SiteMapIndex()
        {
            IEnumerable<DateTime> postDateGroups = postService.GetPostDateGroups();

            return new HotpotViewModelItems<DateTime>(postDateGroups);
        }

        public HotpotViewModelItems<Post> SiteMap(OneMonthDateRangeAddress dateRangeAddress)
        {
            return new HotpotViewModelItems<Post>(postService.GetPosts(dateRangeAddress));
        }
    }
}
